<extend name="Public:common"/>
<block name="css">
    <style>
        #show_img img{max-width: 800px;max-height: 500px;}
        .left{width:25%;}
        .right{width:75%;}
    </style>
</block>
<block name="content">
    <div class="page-header" style="background-color: #fff!important"><h1><i class="fa fa-home"></i> 首页 &gt;产品管理&gt;线路发布 </h1></div>
    <ul id="nav" class="nav nav-tabs">
        <li role="presentation" class=""><a href="javascript:void(0)">第一步基本信息</a></li>
        <li role="presentation" class=""><a href="javascript:void(0)">第二步价格计划</a></li>
        <li role="presentation" class=""><a href="javascript:void(0)">第三步行程安排</a></li>
        <li role="presentation" class="active"><a href="javascript:void(0)">第四步签证添加</a></li>
        <li role="presentation" class=""><a href="javascript:void(0)">第五步附加产品</a></li>
    </ul>
    <div class="tab-content">
    <!-- 签证添加 第四步-->
            <form action="{:U('step4_action')}" method="post" class="form-horizontal">
                <input type="hidden" name="id" value="{:I('id')}">
                <!-- 隐藏域传递当前是第几步 -->
                <table class="table table-striped table-bordered table-hover table-condensed text-center">
                    <tbody>
                        <tr>
                            <td class="left text-right">
                                <p class=" label label-info">签证：</p>
                            </td>
                            <td class="right text-left">
                                <select id='visa_id' name="visa_id" class="form-input" >
                                    <option value=''>请选择签证</option>
                                    <volist name="visa" id="vo">
                                        <option value='{$vo['visa_id']}' <if condition="$lineInfo['visa_id'] == $vo['visa_id'] ">selected</if> >{$vo['visa_name']}</option>
                                    </volist>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td class="left text-right">
                                <p class=" label label-info">价格：({$supplierInfo['currency']})</p>
                            </td>
                            <td class="right text-left">
                                <span style="color:red;" id="price">
                                    <input type="text" value="{$choseVisa.visa_price}" readonly>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td class="left text-right">
                                <p class=" label label-info">签证示例图片：</p>
                            </td>
                            <td class="right text-left">
                                <div id="show_img" style="text-align: left;">
                                    {$choseVisa.sample}
                                </div>
                            </td>
                        </tr>

                    </tbody>
                </table>
                <div class="row text-center">
                    <a  href="{:U('form_step3',array('id'=>I('id')))}" class="btn btn-info">上一步</a>
                    <input type="submit" class="btn btn-warning" value="保存 进入下一步"/>
                    <a href="{:U('form_step5',array('id'=>I('id')))}" class="btn btn-info">跳过</a>
                </div>
            </form>
    </div>
</block>
<block name="js">
    <script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#visa_id").on('change', function () {
                $('#price').text(0);
                $('#show_img').empty();
                var value = $("#visa_id").val();
                if(!value){
                    return false;
                }
                $.post("{:U('line/visa_ajax')}", {visa_id: value}, function (data) {
                    $("#price").html('<input type="text" value="'+data[0]['visa_price']+'" readonly>');
                    $("#show_img").empty();
                    $("#show_img").append(data[0]['sample']);
                }, 'json');
            });
        });
    </script>

</block>

